//框架
var express = require('express');
//模板
var ejs  = require('ejs');
//配置文件
var config = require('./config');
//控制层文件
var homectrl = require('./controllers/homectrl');
var golfctrl = require('./controllers/golfctrl')

//建立服务器对象
var app = express.createServer();

app.use(express.static(__dirname + '/public',{maxAge:3600000 * 24 *30}));
app.use(express.bodyParser());

app.set('view engine','html');
app.set('views',__dirname + '/views');
app.register('html',ejs);



//Routing 路由
//首页区动index函数
app.get('/',todo.index);
//foo 区动 foo函数
app.get('/app/foo',appctrl.foo);

app.listen(config.port);